"""
API应用的URL配置
"""
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from .views import StockViewSet, StockDailyViewSet, StockSearchView

# 创建路由器实例
router = DefaultRouter()

# 注册路由
router.register(r'stocks', StockViewSet)
router.register(r'stocks-daily', StockDailyViewSet, basename='stocks-daily')

urlpatterns = [
    # 包含自动路由生成的URL
    path('', include(router.urls)),
    
    # 明确定义的URL模式
    path('search/', StockSearchView.as_view(), name='stock-search'),
]
